#!/usr/bin/env python
# -*- coding: UTF-8 -*-

"""
This are some of the most common configuration settings you have to
stablish on your applications. I have written default values to allow
the application work.

To use copy this file to properties.py, this is the file we import
int settings.py and could be different in your production environment,
so get properties.py get out from your version control management program.
"""

# -------------------------------------------------------------------
# Autor: aaloy
# -------------------------------------------------------------------
import os

# -----------------------------------------------------------------------------
# system configuration
# -----------------------------------------------------------------------------

debug=True

admins = (
        ('aaloy','aaloy@apsl.net'),
    )
managers = admins

# -----------------------------------------------------------------------------
# database configuration
# -----------------------------------------------------------------------------
database_engine='sqlite3'
database_name='db.sqlite'
database_user=''
database_password=''
database_host=''
database_port=''
# --------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# urls
# -----------------------------------------------------------------------------
app_root =  os.path.abspath(os.path.dirname(__file__))
media_root=os.path.join(app_root, 'media/')
media_url = 'http://localhost:8000/media/'
admin_media_prefix ='/adm_media/'
# ----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# cache and session
# -----------------------------------------------------------------------------
# use dummy if you don't want cache o while developing
# uses the default session engine (database, or file or memory)
cache_backend = 'locmem:///'
cache_prefix='appfuse_'
cache_seconds=300
session_engine='django.contrib.sessions.backends.file'
#session_engine='django.contrib.sessions.backends.cache' 
#use cache if you have it
secret_key='no-oblidis-generar-la-secret-key'
# --------------------------------------------------------------------------


# -----------------------------------------------------------------------------
# templates
# -----------------------------------------------------------------------------
language_code = 'en'
template_dirs = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(app_root,'templates/'),
)


# -----------------------------------------------------------------------------
# logging configuration
# -----------------------------------------------------------------------------
# You can comment filename to output to console or give it an absolute path
# in your files use
# 
# import logging
# log = logging.getLogger(__name__)
#

import logging
logging.basicConfig(
    filename='the_filename_log_output.log',
    format="%(asctime)s-%(levelname)s-%(name)s-%(lineno)s-%(message)s",
    level = logging.INFO,
)

# Activate the per module logging level if you need it
#logging.getLogger('app.module.file').setLevel(logging.INFO)
#logging.getLogger('app2.module.file').setLevel(logging.ERROR)
